/**
 * 
 */
package com.wll.thread.concurrent.ch03.newSingle;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import com.wll.thread.concurrent.base.LiftOff;

/**
 * @author wull
 *
 */
public class TestNewSingle {
	public static void main(String [] args){
		// SingleThreadExecutor相当于线程数量为1的FixedThreadPool
		// 从执行结果可以发现，一个线程执行完毕后，才执行下一个线程
		ExecutorService exec = Executors.newSingleThreadExecutor();
		for(int i =0;i<5;i++){
			exec.execute(new LiftOff());
		}
		exec.shutdown();
	}
}
